package com.fanketly.musicdiary

import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.material.ripple.rememberRipple
import androidx.compose.runtime.CompositionLocalProvider
import androidx.core.view.WindowCompat
import androidx.navigation.compose.rememberNavController
import com.fanketly.musicdiary.navigation.SetupNavGraph
import com.fanketly.musicdiary.ui.components.WhiteIndication
import com.fanketly.musicdiary.ui.theme.MusicDiaryTheme
import com.fanketly.musicdiary.utls.PermissionsUtils
import com.hjq.permissions.Permission
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class DiaryActivity : ComponentActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WindowCompat.setDecorFitsSystemWindows(window, false)
        PermissionsUtils.openPermissions(//Apply for the required permissions
            this,
            Permission.CAMERA,
            Permission.READ_MEDIA_IMAGES,
//            Permission.READ_EXTERNAL_STORAGE,
//            Permission.WRITE_EXTERNAL_STORAGE
        ) { _, _ ->
            setContent {
                MusicDiaryTheme {
                    val navController = rememberNavController()
                    SetupNavGraph(navController = navController)
                }
            }
        }
    }
}

